import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:osg/controllers/custom_widget.dart';

class Pledge extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final totalHeight = MediaQuery.of(context).padding.top + 15;
    return 
    // Scaffold(
    //   body: Column(
    //     mainAxisAlignment: MainAxisAlignment.center,
    //     crossAxisAlignment: CrossAxisAlignment.center,
    //     children: [
    //       Align(
    //         child:  Image.asset('static/loggin.png',width: 250,)
    //         ,
    //       )
         
    //     ],
    //   ),
    // );
    
    Scaffold(
      body: ListView(
        padding: EdgeInsets.only(left: 15, right: 15, top: totalHeight),
        children: [
          Stack(
            children: [
              Container(
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular((15)),
                  gradient: LinearGradient(
                    colors: [
                      Color(0xff5B6271),
                      Color(0xff0F172B),
                    ], // 定义颜色列表
                    begin: Alignment.topLeft, // 渐变开始的位置
                    end: Alignment.bottomRight, // 渐变结束的位置
                  ),
                ),
                child: Image.asset('static/web/zhiyaongbg.png'),
              ),
              Positioned(
                  child: Padding(
                padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text('质押总收益',
                            style: TextStyle(
                                fontSize: 12, color: Color(0XFFFFFFFF))),
                        Row(
                          children: [
                            Text('0',
                                style: TextStyle(
                                    fontSize: 30, color: Color(0XFFFFFFFF))),
                            Text('SP',
                                style: TextStyle(
                                    fontSize: 12, color: Color(0XFFFFFFFF))),
                          ],
                        )
                      ],
                    ),
                    GestureDetector(
                      onTap: () => {
 Get.dialog(
                AlertDialog(
                  backgroundColor: Colors.transparent,
                  content: Stack(
                    children: [
                      ClipRRect(
                        borderRadius: BorderRadius.circular(15.0),
                        child: Image.asset(
                          'static/qidai.png',
                          width: 250,
                          fit: BoxFit.fitWidth,
                        ),
                      ),
                    ],
                  ),
                ),
              )

                        // Get.toNamed('/web_tabs/pledge/my_pledge')
                        },
                      child: Container(
                        width: 70,
                        height: 28,
                        alignment: Alignment.center,
                        decoration: BoxDecoration(
                            color: Color(0XFF515C79),
                            borderRadius: BorderRadius.circular(28)),
                        child: Text(
                          '我的质押',
                          style:
                              TextStyle(fontSize: 12, color: Color(0XFFFFFFFF)),
                        ),
                      ),
                    )
                  ],
                ),
              )),
              Positioned(
                bottom: 20,
                child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 15),
                    child: Row(
                      children: [
                        Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text('今日收益',
                                style: TextStyle(
                                    fontSize: 11, color: Color(0XFF9EA9BA))),
                            Row(
                              children: [
                                Text('0',
                                    style: TextStyle(
                                        fontSize: 16,
                                        color: Color(0XFFFFFFFF))),
                                Text('SP',
                                    style: TextStyle(
                                        fontSize: 12,
                                        color: Color(0XFFFFFFFF))),
                              ],
                            )
                          ],
                        ),
                        SizedBox(
                          width: 80,
                        ),
                        Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text('昨日收益',
                                style: TextStyle(
                                    fontSize: 11, color: Color(0XFF9EA9BA))),
                            Row(
                              children: [
                                Text('0',
                                    style: TextStyle(
                                        fontSize: 16,
                                        color: Color(0XFFFFFFFF))),
                                Text('SP',
                                    style: TextStyle(
                                        fontSize: 12,
                                        color: Color(0XFFFFFFFF))),
                              ],
                            )
                          ],
                        ),
                      ],
                    )),
              )
            ],
          ),
          SizedBox(
            height: 30,
          ),
          Column(
            children: [
              Image.asset(
                'static/web/zhiyahoudong.png',
                width: 175,
                fit: BoxFit.fitWidth,
              ),
              SizedBox(height: 5),
              Text('质押期越长，收益越高',
                  style: TextStyle(fontSize: 11, color: Color(0XFF999999))),
            ],
          ),

              SizedBox(height: 50,),
             Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Image.asset('static/qidai.png',
                          width: 250,
                          ) 
                          ],
                        ),

              for(var item in [])

          Container(
            margin: EdgeInsets.only(top: 15),
            padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
            decoration: BoxDecoration(
              color: Color(0XFFF8F9FD),
              borderRadius: BorderRadius.circular(10),
            ),
            child: Row(
              children: [
                ClipRRect(
                  borderRadius: BorderRadius.circular(8.0),
                  child: Image.asset(
                    'static/aaa.png',
                    width: 86,
                    height: 86,
                    fit: BoxFit.fill,
                  ),
                ),
                SizedBox(
                  width: 10,
                ),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text('超现实元宇宙数字艺术展厅',
                        style: TextStyle(
                            fontSize: 14, color: Color((0XFF0F172B)))),
                    SizedBox(
                      height: 3,
                    ),
                    Row(
                      children: [
                        Text('最高收益',
                            style: TextStyle(
                                fontSize: 11, color: Color((0XFF999999)))),
                        Text('20%',
                            style: TextStyle(
                                fontSize: 12, color: Color((0XFF542AFF)))),
                      ],
                    ),
                    SizedBox(
                      height: 3,
                    ),
                    Row(
                      children: [
                        Text('开始时间',
                            style: TextStyle(
                                fontSize: 11, color: Color((0XFF999999)))),
                        Text('2024.06.10 16:00',
                            style: TextStyle(
                                fontSize: 11, color: Color(((0XFF0F172B))))),
                      ],
                    ),
                    SizedBox(
                      height: 3,
                    ),
                    Row(
                      children: [
                        Text('结束时间',
                            style: TextStyle(
                                fontSize: 11, color: Color((0XFF999999)))),
                        Text('2024.06.10 16:00',
                            style: TextStyle(
                                fontSize: 11, color: Color((0XFF0F172B)))),
                      ],
                    ),
                  ],
                ),
                Expanded(child: SizedBox()),
                GestureDetector(
                  onTap: ()=>{
                    Get.toNamed('/web_tabs/pledge/pledge_detail')
                  },
                  child: Container(
                  margin: EdgeInsets.only(top: 50),
                  padding: EdgeInsets.symmetric(horizontal: 10, vertical: 3),
                  decoration: BoxDecoration(
                    color: Color((0XFF0F172B)),
                    borderRadius: BorderRadius.circular((15)),
                  ),
                  child: Text('质押',
                      style:
                          TextStyle(fontSize: 12, color: Color((0XFFFFFFFF)))),
                ),
                )
                
              ],
            ),
          )
        ],
      ),
    );
  }
}
